/**
 * 
 */
package org.vidyakiran.app.server;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.vidyakiran.app.server.dao.impl.OrganisationDetailDaoJpaImpl;
import org.vidyakiran.app.server.domain.entity.Organisation;

/**
 * @author Harpreet
 *
 */
@Controller

public class TestController {

	@Autowired
	private OrganisationDetailDaoJpaImpl orgDao;
	
	@RequestMapping(value = "/test.do")
	public String getFirst(String name, Model model) {
		model.addAttribute("name", name);
		
		Organisation org = new Organisation();
		org.setName(name);
		org = orgDao.saveOrUpdateOrgDetails(org);
		
		
		model.addAttribute("id", org.getId());
		return "tested";
	}
}
